$(function(){
    //1. 显示用户信息
    var render = function(){
        getuserdata(function(data){
            console.log(data)
            $('.mui-media-body').html(data.username+'<p class="mui-ellipsis">绑定手机:'+data.mobile+'</p>')
        })
    }
    render()
    // 2.退出操作
    $('.mui-block').on('tap',function(){
        $.ajax({
            type:'get',
            url:'/user/logout',
            data:'',
            dataType:'json',
            success:function(data){
                if(data.success){
                    location.href = '/m/user/login.html'
                }
            }
        })
    })
})

var getuserdata = function(callback){
    lt.loginFilter({
        type:'get',
        url:'/user/queryUserMessage',
        data:'',
        dataType:'json',
        success:function(data){
            callback && callback(data)
        }
    })
}